package etxt2db.main;

import java.io.File;

import org.apache.tools.ant.taskdefs.Copy;

public class PrefixAdding {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		String[][] databases = {{"Bloomberg","BBG"},{"TheCelebrityCafe","TCC"},{"TheEconomist","TET"},{"UsNews","UNS"},{"Variety","VRT"}};

		String dataFolderName = "/home/pjbarrio/Dataset/NaturalDisaster/";
		
		String dataFName = dataFolderName + "/data/";
		
		for (int i = 0; i < databases.length; i++) {
			
			String folderName = dataFolderName + databases[i][0];
			
			File folder = new File(folderName);
			
			File[] files = folder.listFiles();
			
			for (int j = 0; j < files.length; j++) {
				
				copyFiles(files[j], new File(dataFName + databases[i][1] + "-" + files[j].getName()));
				
			}
			
		}
		
	}

	private static void copyFiles(File from, File to) {

		Copy copier = new Copy();
				
		copier.setFile(from);
		
		copier.setTofile(to);
		
		copier.execute();
		
	}

	
}
